﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="PromotionCode-List.aspx.cs" Inherits="PromotionCode_List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
   <link href="css/DT_bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="css/select2_metro.css" rel="stylesheet" type="text/css" />
    <%--css for delete confirmation box--%>
    <link href="css/Popup.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div class="portlet box yellow">
        <div class="portlet-title">
            <div class="caption">
                <i class="icon-globe"></i>Promotion Code</div>
        </div>
        <div class="portlet-body">
            <table class="table table-striped table-bordered table-hover table-full-width" id="sample_2">
                <thead>
                    <tr>
                        <th>
                            Code
                        </th>
                        <th>
                            Subscription
                        </th>
                           <th>
                            Discount
                        </th>
                        <th>
                            Start Date
                        </th>
                        <th>
                            Expiry Date
                        </th>
                        <th>
                           Allowed User
                        </th>
                          <th>
                           Used By
                        </th>
                        <th class="hidden-480">
                            Action
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <asp:Repeater ID="rptPromotionCode" runat="server" OnItemCommand="OnItemCommand" >
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <%# Eval("Code")%>
                                </td>
                                <td>
                                    <%# Eval("PlanName")%>
                                </td>
                                <td>
                                  <%--  <%# Eval("Discount")%>--%>
                                    <asp:HiddenField runat="server" ID="hdfDiscountType" Value='<%# Eval("DiscountType") %>' />
                                    <asp:Label runat="server" id="lblDiscountType" Text='<%# Eval("DiscountName") %>'></asp:Label>
                                </td>
                                <td>
                                    <%# Eval("StartDate","{0:dd/MM/yyyy}")%>
                                </td>
                                <td>
                                    <%# Eval("ExpiryDate","{0:d/MM/yyyy}")%>
                                </td>
                                <td>
                                       <asp:Label runat="server" id="lblAllowUser" Text='<%# Eval("AllowUserDetail") %>'></asp:Label>
                                </td>
                                   <td>
                                   <%# Eval("UsedCount") %>
                                 
                                </td>
                                <td>
                                    <center>
                                        <asp:HiddenField runat="server" ID="hdf" Value='<%# Eval("Code") %>' />
                                        <asp:LinkButton runat="server" ID="lnkDelete" CommandName="Delete" OnClientClick="callAlert(this);return false;"
                                            CommandArgument='<%# Eval("Id") %>' Text="delete">
                                              <img src="img/cross-circle.png" width="16" height="16" alt="Delete">
                                        </asp:LinkButton>
                                    </center>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </tbody>
            </table>
        </div>
    </div>
    <script type="text/javascript" src="js/select2.min.js"></script>
    <script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="js/DT_bootstrap.js"></script>
    <script src="js/table-advanced.js" type="text/javascript"></script>
    <script>
        jQuery(document).ready(function () {
            TableAdvanced.init();
        });
    </script>
    <%--confirmation popup--%>
    <script src="js/PopupManager.js" type="text/javascript"></script>
    <script>
        function callAlert(element) {


            var $btn = $(element) // Gets clicked button
            var hiddenBValue = $btn.prev().val(); // Gets hidden element value

            AlertCust(element, 'Confirmation', 'Are you sure want to remove ' + hiddenBValue + ' ?', IconType.information, PromptType.OkCancel, null, null);
        }
    </script>
</asp:Content>
